package it.win4buy.models
{
    import it.win4buy.entities.PlaceHolderVO;
    import it.win4buy.entities.UserDataVO;

    import mx.collections.ArrayCollection;

    /**
     *
     *	autore:
     *  pierangelo.mancusi@gmail.com
     *
     */

    public class ApplicationModel
    {



        //-------------------------------------------
        //
        // Injected properties
        //
        //-------------------------------------------


        //-------------------------------------------
        //
        // Private Properties
        //
        //-------------------------------------------

        /**
         * Used to store User's Data
         */
        private var _userData:UserDataVO;


        /**
         * Used to store the PlaceHolder's ArrayCollection
         */
        private var _placeHolderList:ArrayCollection;


        /**
         * Selected PlaceHolder from the main datagrid( PlaceHolder Selection )
         */
        private var _selectedPlaceHolder:int=-1;



        /**
         *Registered PlaceHolder.
         */
        private var _registeredPlaceholder:int=-1;
        /**
         * FlashVar used to store the Application MODE.<br>
         * It's used <b>ONLY</b> at Application's Startup<br>
         * <b>PlaceHolderSelection=0 (default)<br>
         * PLAY=1</b><br>
         *
         * It should be setted in the flash vars.
         */
        private var _applicationState:int=0;


        /**
         *Number of the question displaying.<br>
         *Defualt value = -1.
         */
        private var _questionPlaying:int=-1;


        /**
         *Max number PlaceHolder's questions.
         */
        private var _maxNumQuestions:int;

        //-------------------------------------------
        //
        // Getters / Setters
        //
        //-------------------------------------------

        [Bindable]
        /**
         *Max number PlaceHolder's questions.
         */
        public function get maxNumQuestions():int
        {
            return _maxNumQuestions;
        }

        public function set maxNumQuestions(value:int):void
        {
            _maxNumQuestions=value;
        }

        [Bindable]
        /**
         *Number of the question displaying
         */
        public function get questionPlaying():int
        {
            return _questionPlaying;
        }

        public function set questionPlaying(value:int):void
        {
            _questionPlaying=value;
        }

        /**
         *Registered PlaceHolder's ID.<br>
         * Default values is -1.
         */
        public function get registeredPlaceholder():int
        {
            return _registeredPlaceholder;
        }

        public function set registeredPlaceholder(value:int):void
        {
            _registeredPlaceholder=value;
        }

        [Bindable]
        /**
         * FlashVar used to store the Application MODE.<br>
         * It's used <b>ONLY</b> at Application's Startup.<br>
         * <b>PlaceHolderSelection=0 (default)<br>
         * PLAY=1</b>
         */
        public function get applicationState():int
        {
            return _applicationState;
        }

        /**
         * @private
         */
        public function set applicationState(value:int):void
        {
            _applicationState=value;
        }


        [Bindable]
        /**
         * Selected PlaceHolder from datagrid.<br>
         *
         */
        public function get selectedPlaceHolder():int
        {
            return _selectedPlaceHolder;
        }

        public function set selectedPlaceHolder(value:int):void
        {
            _selectedPlaceHolder=value;
        }

        [Bindable]

        /**
         * Used to store the PlaceHolder's ArrayCollection
         */
        public function get placeHolderList():ArrayCollection
        {
            return _placeHolderList;
        }

        public function set placeHolderList(value:ArrayCollection):void
        {
            _placeHolderList=value;
        }


        [Bindable]
        /**
         * Used to store User's Data
         */
        public function get userData():UserDataVO
        {
            return _userData;
        }

        public function set userData(value:UserDataVO):void
        {
            _userData=value;
        }


        //-------------------------------------------
        //
        // Constructor
        //
        //-------------------------------------------

        public function ApplicationModel()
        {
            userData=new UserDataVO();
            placeHolderList=new ArrayCollection();
        }


        //-------------------------------------------
        //
        // Private Methods
        //
        //-------------------------------------------


    }
}